package com.sagframe.sagacity.sqltoy.plus.multi.delete;

import com.sagframe.sagacity.sqltoy.plus.conditions.eumn.SqlKeyword;
import com.sagframe.sagacity.sqltoy.plus.multi.AbstractStringMultiWrapper;
import com.sagframe.sagacity.sqltoy.plus.multi.MultiContext;
import com.sagframe.sagacity.sqltoy.plus.multi.StringMultiStepWrapper;

public class MultiDeleteWrapper extends AbstractStringMultiWrapper<MultiDeleteWrapper> implements StringDelete<MultiDeleteWrapper>{

    public MultiDeleteWrapper() {
        super((Class<?>)null);
        context.addOperateSqlSegment(SqlKeyword.DELETE);
    }

    public MultiDeleteWrapper(MultiContext context) {
        super(context);
    }

    @Override
    protected MultiDeleteWrapper instance() {
        return new MultiDeleteWrapper(context);
    }

    @Override
    public StringMultiStepWrapper.LambdaFrom<MultiDeleteWrapper> delete(Class<?>... classes) {
        if (classes != null && classes.length > 0) {
            for (Class<?> clazz : classes) {
                context.addDeleteSqlAssembler(clazz);
            }
        }
        return new StringMultiStepWrapper.MultiStepWrapperBuilder<>(typedThis, context);
    }
}
